/*!
 *	JavaScript Document
 *	author:qinjieyou
 *	date:Dec,15 2011
 */
$(function() {
	var c = $("#resendemail"), d = $("#resendvcode_error");
	if (c[0]) {
		var a = {
			code : $("#code").val()
		};
		c.click(function() {
			var f = this, e = $(this);
			$.post(resendemail, a, function(g) {
				switch (g + "") {
				case "110000":
					d.hide();
					bdPass.timeDown(120, function(h) {
						e.val("重新发送(" + h + "秒)")
					}, function() {
						f.disabled = true;
						e.addClass("resend_disabled").val("重新发送(120秒)")
					}, function() {
						f.disabled = false;
						e.removeClass("resend_disabled").val("重新发送")
					});
					break;
				default:
					d.css("display", "inline-block")
				}
			})
		})
	}
	var b = $("#timer");
	if (b[0]) {
		bdPass.timeDown(5, function(e) {
			b.text(e)
		}, bdPass.voidFunc, function() {
			location.href = b.parent().attr("href")
		})
	}
});